<?php
@session_start();
require_once("../connect_db.php");
if(isset($_GET["temp"])){
$sqlTemp="select * from course where course_id='".$_GET["temp"]."'";
$queryTemp=mysql_query($sqlTemp);
$resultTemp=mysql_fetch_array($queryTemp);
}
?>
<form method="post" enctype="multipart/form-data" name="frmreg" id="frmreg">

<div class="row">
	<div class="col-md-12">
		<div class="panel panel-danger" >
		  <div class="panel-heading">
			<h3 class="panel-title">ข้อมูลคอร์ส</h3>
		  </div>
		  <div class="panel-body">
			  <div class="form-group">
				<label for="inputname1" class="col-sm-5 control-label">ชื่อ</label> 
				<div class="col-sm-7">
				  <input type="text" class="form-control" id="course_name" name="course_name" 
				  value="<?php if(isset($resultTemp["course_name"])) echo $resultTemp["course_name"]?>" placeholder="">
				   <p>
				</div>
			  </div>
			
			
				
				<div class="form-group">
				<label for="inputtel" class="col-sm-5 control-label">ราคา</label>
				<div class="col-sm-7">
				  <input type="text" class="form-control" 
					value="<?php if(isset($resultTemp["price"])) echo $resultTemp["price"]?>"
				  id="course_price" name="course_price"  placeholder="">
				  <p>
				</div>
				</div>
				<div class="form-group">
				<label for="inputaddr" class="col-sm-5 control-label">จำนวนเวลา(ชม.)</label>
				<div class="col-sm-7">
				  <input type="text" class="form-control"
					value="<?php if(isset($resultTemp["hour_num"])) echo $resultTemp["hour_num"]?>"
				  id="course_hour" name="course_hour" placeholder="">
				  <p>
				</div>
				</div>
				
					<div class="form-group">
				<label for="inputaddr" class="col-sm-5 control-label">รายละเอียด</label>
				<div class="col-sm-7">
				<textarea class="form-control" id="course_detail" name="course_detail" rows="3">
				<?php if(isset($resultTemp["course_detail"])) {echo $resultTemp["course_detail"];}?>
				</textarea>
				  
				
				</div>
				</div>
			
          
              
                
			  <div class="form-group">
				<div class="col-sm-offset-5 col-sm-7"><br>
                <span class="style30" id="displayAJAX"></span>
				<input type="hidden" name="temp" id="temp" 
				<?php if(!isset($resultTemp["course_id"])) {}
				else {echo "value='".$resultTemp["course_id"]."'"; }
				?>   />
                <input type="button" class="btn btn-success" name="button" id="button" 
				value="
				<?php if(!isset($resultTemp["course_id"])){ echo "เพิ่มคอร์ส";}
				else {echo "แก้ไข";} ?>" onClick='validate_course_register();' />
 
				<button type="button" class="btn btn-danger" onClick="if(window.confirm('ต้องการยกเลิกกรุณายืนยัน')) {}
				$('#h3title').html('ข้อมูลคอร์ส');
				$('#mainscreen').load('admin/manage_course_page.php');
				">ยกเลิก</button>
				</div>
				<div class="col-sm-offset-7 col-sm-4">
				  
				</div>
				
			  </div>
			 
			
		  </div>
		</div>
	</div>
</div>
</form>
